function Hint()
{
}
//for login
function RefreshCheckCode(){
	var obj=$("ccImg");
	if (!obj)
		return false;
	var cc=obj.src;
	var p=cc.indexOf("=");
	if (p>=0 && cc.substr(p-1,1)=='c')
		cc=cc.substr(p+1,1);
	else
		cc=4;
	obj.src="CheckCodeImg.aspx?cc="+cc+"&t="+ Math.random();
	return false;
}

//for register.aspx
function CheckNameResult() {
	$("nameComment").innerText=this.req.responseText;
}
function CheckNameUnique(obj) {
	if (obj.value != "") {
		$("nameComment").innerText="Loading...";
		new ContentLoader("par.aspx?t=0&name=" + encodeURI(obj.value), CheckNameResult);
	}
	else {
		alert("请先输入用户名！");
		$("nameComment").innerText="*中英文皆可";
		obj.focus();
	}
}
//validate the register form
function CheckReg()
{
	var form=document.forms[0];
	if (form.name.value.length=="")
	{
	    alert("请输入用户名");
	    form.name.focus();
	    return false;
	}
	if (form.password.value.length<6)
	{
	    alert("您设置的密码长度太短啦！");
	    form.password.focus();
	    return false;
	}
	if (form.password2.value!=form.password.value)
	{
	    alert("2次输入的密码不对");
		form.password.select();
	    form.password.focus();
	    return false;
	}
	var emailPattern=/^[a-z0-9]*@[a-z0-9][a-z0-9.]*[a-z0-9]$/;	
	if (!emailPattern.exec(form.email.value))
	{
	    alert("您的邮箱输入有误,请仔细检查！");
		form.email.select();
	    form.email.focus();
	    return false;
	}
	if (form.question.value=="")
	{
	    alert("密码保护问题所有助于您记忆密码保护答案，还是不要留空吧");
	    form.question.focus();
	    return false;
	}
	if (form.answer.value.length<4)
	{
	    alert("密码保护答案不够复杂~~");
	    form.answer.focus();
	    return false;
	}
	if (form.checkCode.value.length<4)
	{
		alert("请输入正确验证码");
		form.checkCode.focus();
		return false;
	}
	return true;
}
